home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / chardet / nsICharsetResolver.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  137 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsICharsetResolver.idl
  3.  */
  4.  
  5. #ifndef __gen_nsICharsetResolver_h__
  6. #define __gen_nsICharsetResolver_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIWebNavigation; /* forward declaration */
  18.  
  19. class nsIChannel; /* forward declaration */
  20.  
  21.  
  22. /* starting interface:    nsICharsetResolver */
  23. #define NS_ICHARSETRESOLVER_IID_STR "d143a084-b626-4614-845f-41f3ca43a674"
  24.  
  25. #define NS_ICHARSETRESOLVER_IID \
  26.   {0xd143a084, 0xb626, 0x4614, \
  27.     { 0x84, 0x5f, 0x41, 0xf3, 0xca, 0x43, 0xa6, 0x74 }}
  28.  
  29. class NS_NO_VTABLE nsICharsetResolver : public nsISupports {
  30.  public: 
  31.  
  32.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICHARSETRESOLVER_IID)
  33.  
  34.   /**
  35.      * Called to resolve the charset that should be used for parsing the
  36.      * document being loaded from aChannel.
  37.      *
  38.      * If the charset cannot be resolved, but the implementation of
  39.      * nsICharsetResolver wants to be notified of the final resolved charset
  40.      * when one is available, it can set wantCharset to true.  If this is done,
  41.      * the caller of requestCharset is responsible for calling
  42.      * notifyResovedCharset and passing it the final resolved charset and the
  43.      * closure that requestCharset set.
  44.      * 
  45.      * @param aWebNavigation the nsIWebNavigation the document is being loaded
  46.      *                       in.  May be null.
  47.      * @param aChannel the channel the document is coming in from.
  48.      * @param aWantCharset gets set to true if notifyResolvedCharset should be
  49.      *                     called with the given closure object.
  50.      * @param aClosure a resulting object which should be passed
  51.      *                 to notifyResolvedCharset if wantCharset is set to
  52.      *                 true.
  53.      * @returns the resolved charset, or the empty string if no
  54.      *          charset could be determined.
  55.      */
  56.   /* ACString requestCharset (in nsIWebNavigation aWebNavigation, in nsIChannel aChannel, out boolean aWantCharset, out nsISupports aClosure); */
  57.   NS_IMETHOD RequestCharset(nsIWebNavigation *aWebNavigation, nsIChannel *aChannel, PRBool *aWantCharset, nsISupports **aClosure, nsACString & _retval) = 0;
  58.  
  59.   /**
  60.      * notifyResolvedCharset
  61.      *
  62.      * some implementations may request that they be notified when the
  63.      * charset is actually detected. 
  64.      *
  65.      * @param charset the detected charset
  66.      * @param closure the closre returned by detectCharset() above
  67.      */
  68.   /* void notifyResolvedCharset (in ACString charset, in nsISupports closure); */
  69.   NS_IMETHOD NotifyResolvedCharset(const nsACString & charset, nsISupports *closure) = 0;
  70.  
  71. };
  72.  
  73. /* Use this macro when declaring classes that implement this interface. */
  74. #define NS_DECL_NSICHARSETRESOLVER \
  75.   NS_IMETHOD RequestCharset(nsIWebNavigation *aWebNavigation, nsIChannel *aChannel, PRBool *aWantCharset, nsISupports **aClosure, nsACString & _retval); \
  76.   NS_IMETHOD NotifyResolvedCharset(const nsACString & charset, nsISupports *closure); 
  77.  
  78. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  79. #define NS_FORWARD_NSICHARSETRESOLVER(_to) \
  80.   NS_IMETHOD RequestCharset(nsIWebNavigation *aWebNavigation, nsIChannel *aChannel, PRBool *aWantCharset, nsISupports **aClosure, nsACString & _retval) { return _to RequestCharset(aWebNavigation, aChannel, aWantCharset, aClosure, _retval); } \
  81.   NS_IMETHOD NotifyResolvedCharset(const nsACString & charset, nsISupports *closure) { return _to NotifyResolvedCharset(charset, closure); } 
  82.  
  83. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  84. #define NS_FORWARD_SAFE_NSICHARSETRESOLVER(_to) \
  85.   NS_IMETHOD RequestCharset(nsIWebNavigation *aWebNavigation, nsIChannel *aChannel, PRBool *aWantCharset, nsISupports **aClosure, nsACString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->RequestCharset(aWebNavigation, aChannel, aWantCharset, aClosure, _retval); } \
  86.   NS_IMETHOD NotifyResolvedCharset(const nsACString & charset, nsISupports *closure) { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyResolvedCharset(charset, closure); } 
  87.  
  88. #if 0
  89. /* Use the code below as a template for the implementation class for this interface. */
  90.  
  91. /* Header file */
  92. class nsCharsetResolver : public nsICharsetResolver
  93. {
  94. public:
  95.   NS_DECL_ISUPPORTS
  96.   NS_DECL_NSICHARSETRESOLVER
  97.  
  98.   nsCharsetResolver();
  99.  
  100. private:
  101.   ~nsCharsetResolver();
  102.  
  103. protected:
  104.   /* additional members */
  105. };
  106.  
  107. /* Implementation file */
  108. NS_IMPL_ISUPPORTS1(nsCharsetResolver, nsICharsetResolver)
  109.  
  110. nsCharsetResolver::nsCharsetResolver()
  111. {
  112.   /* member initializers and constructor code */
  113. }
  114.  
  115. nsCharsetResolver::~nsCharsetResolver()
  116. {
  117.   /* destructor code */
  118. }
  119.  
  120. /* ACString requestCharset (in nsIWebNavigation aWebNavigation, in nsIChannel aChannel, out boolean aWantCharset, out nsISupports aClosure); */
  121. NS_IMETHODIMP nsCharsetResolver::RequestCharset(nsIWebNavigation *aWebNavigation, nsIChannel *aChannel, PRBool *aWantCharset, nsISupports **aClosure, nsACString & _retval)
  122. {
  123.     return NS_ERROR_NOT_IMPLEMENTED;
  124. }
  125.  
  126. /* void notifyResolvedCharset (in ACString charset, in nsISupports closure); */
  127. NS_IMETHODIMP nsCharsetResolver::NotifyResolvedCharset(const nsACString & charset, nsISupports *closure)
  128. {
  129.     return NS_ERROR_NOT_IMPLEMENTED;
  130. }
  131.  
  132. /* End of implementation class template. */
  133. #endif
  134.  
  135.  
  136. #endif /* __gen_nsICharsetResolver_h__ */
  137.